projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41b7f8b
)
* xterm.c (x_draw_underwave): Check for integer overflow.
author
Paul Eggert
<eggert@cs.ucla.edu>
Sun, 17 Jun 2012 07:39:50 +0000
(
00:39
-0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Sun, 17 Jun 2012 07:39:50 +0000
(
00:39
-0700)
This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
src/ChangeLog
patch
|
blob
|
history
src/xterm.c
patch
|
blob
|
history
diff --git
a/src/ChangeLog
b/src/ChangeLog
index 8baeeadc2d5e52090d50aa18a891d56096c0cfc1..662aa5232ab50ef5c92a4f22ec04adcc3377e69e 100644
(file)
--- a/
src/ChangeLog
+++ b/
src/ChangeLog
@@
-1,3
+1,8
@@
+2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ * xterm.c (x_draw_underwave): Check for integer overflow.
+ This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
+
2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
diff --git
a/src/xterm.c
b/src/xterm.c
index 914d195778f9bdd785a28679db5e1b7f93e1cb88..fec661625f2bd65e163f0f02d018d5389ad83353 100644
(file)
--- a/
src/xterm.c
+++ b/
src/xterm.c
@@
-2710,6
+2710,9
@@
x_draw_underwave (struct glyph_string *s)
else
y2 += dy;
+ if (INT_MAX - dx < xmax)
+ abort ();
+
while (x1 <= xmax)
{
XDrawLine (s->display, s->window, s->gc, x1, y1, x2, y2);